package com.example.common.service;

import com.example.common.utils.RestResponse;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.File;

/**
 * @author: mtl
 * @Date: 2022/1/21 15:17
 * @Description:
 */
public interface FileService {

    /**
     * 文件上传
     * @param file
     * @return
     */
    RestResponse handleFileUpload(MultipartFile file);

    /**
     * 文件储存入库
     * @param file
     * @param suffixName
     * @return
     */
    public boolean saveFile(File file,String suffixName);

    /**
     * 下载文件
     * @param id
     * @param response
     * @return
     */
    void downloadFile(Integer id, HttpServletResponse response);

}
